#ifndef ENCODE_H_
#define ENCODE_H_

#include"constant.h"
#include"freq.h"
#include"list.h"
#include"tree.h"
#include<stdio.h>
#include<strings.h>
#include<stdlib.h>


int encode(char * infile,char * outfile,int mode);

int Tree_leaf(TreeNode * tn);

int Tree_height(TreeNode *tn);

void buildCodeBook(TreeNode * root,int ** codebook);

void printCodeBook(int ** codebook,int numRow);

void buildCodeBookHelper(TreeNode * tn,int ** codebook,int * row,int col);

#endif //!ENCODE_H_